<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2018/2/13
 * Time: 下午7:41
 */
$str = 'just do it!';
//  just do it!
echo addslashes( $str ) . PHP_EOL;
$str = "just do it!";
//  just do it!
echo addslashes( $str ) . PHP_EOL;
$str = '\a\b\'';
//  \\a\\b\'
echo addslashes( $str ) . PHP_EOL;
$str = '\\';
//  \\
echo addslashes( $str ) . PHP_EOL;